import 'package:flutter_app/tabs/userpage/setting.dart';
import 'package:flutter/material.dart';
import 'package:flutter_app/tabs/userpage/userPage.dart';
import 'package:flutter_app/tabs/tabs.dart';
import 'package:flutter_app/tabs/loginPage.dart';
import 'package:flutter_app/tabs/userpage/fans.dart';
import 'package:flutter_app/tabs/splashPage.dart';
import 'package:flutter_app/tabs/userpage/follow.dart';

final routes = {
  '/': (context, {arguments}) => Tabs(),
  //'/search':(context,{arguments})=>SearchPage(),
  //'/':(context,{arguments})=>Tabs(),
  '/user': (context, {arguments}) => MyUserPage(),
  '/setting': (context, {arguments}) => SettingPage(),
  '/login': (context, {arguments}) => LoginPage(),
  '/fans': (context, {arguments}) => FansPage(),
  '/follow': (context, {arguments}) => FollowPage(),
  '/splash': (context, {arguments}) => SplashPage(),
};
var onGenerateRoute = (RouteSettings settings) {
  final String name = settings.name;
  final Function pageContentBuilder = routes[name];
  if (pageContentBuilder != null) {
    final Route route = MaterialPageRoute(
        builder: (context) =>
            pageContentBuilder(context, arguments: settings.arguments));
    return route;
  } else {
    final Route route =
        MaterialPageRoute(builder: (context) => pageContentBuilder(context));
    return route;
  }
};
